package com.bean;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

/**
 * SysUser entity. @author MyEclipse Persistence Tools
 */

public class SysUser implements java.io.Serializable {

	// Fields

	/** serialVersionUID*/
	private static final long serialVersionUID = 7591388637383106310L;
	private Long sysUserId;
	private String userName;
	private String userPasswd;
	private String realName;
	private Long role;
	private String roleName;
	private String photo;
	private String introduction;
	private String phone;
	private String email;
	private Timestamp loginTime;
	private Timestamp createTime;
	private Timestamp updateTime;
	private Short status;
	private String statusName;
	private String ip;
	
	private Set drawMoneyRequestRecords = new HashSet(0);

	// Constructors

	/** default constructor */
	public SysUser() {
	}

	/** minimal constructor */
	public SysUser(String userName, String userPasswd, String realName,
			Timestamp createTime, Timestamp updateTime, Short status) {
		this.userName = userName;
		this.userPasswd = userPasswd;
		this.realName = realName;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.status = status;
	}

	/** full constructor */
	public SysUser(String userName, String userPasswd, String realName,
			Long role, String introduction, String phone, String email,
			Timestamp loginTime, Timestamp createTime, Timestamp updateTime,
			Short status) {
		this.userName = userName;
		this.userPasswd = userPasswd;
		this.realName = realName;
		this.role = role;
		this.introduction = introduction;
		this.phone = phone;
		this.email = email;
		this.loginTime = loginTime;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.status = status;
	}

	// Property accessors

	public Long getSysUserId() {
		return this.sysUserId;
	}

	public void setSysUserId(Long sysUserId) {
		this.sysUserId = sysUserId;
	}

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPasswd() {
		return this.userPasswd;
	}

	public void setUserPasswd(String userPasswd) {
		this.userPasswd = userPasswd;
	}

	public String getRealName() {
		return this.realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public Long getRole() {
		return this.role;
	}

	public void setRole(Long role) {
		this.role = role;
	}

	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Timestamp getLoginTime() {
		return this.loginTime;
	}

	public void setLoginTime(Timestamp loginTime) {
		this.loginTime = loginTime;
	}

	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
		//'用户状态（-1：已删除；0：锁定；1：正常）'
		switch(status){
		case 1:
			this.setStatusName("正常");
			break;
		case 0:
			this.setStatusName("锁定");
			break;
		case -1:
			this.setStatusName("已删除");
			break;
		default:
			this.setStatusName("异常");
		}
	}

	/**
	 * @return the ip
	 */
	public String getIp() {
		return ip;
	}

	/**
	 * @param ip the ip to set
	 */
	public void setIp(String ip) {
		this.ip = ip;
	}

	/**
	 * @return the roleName
	 */
	public String getRoleName() {
		return roleName;
	}

	/**
	 * @param roleName the roleName to set
	 */
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	/**
	 * @return the photo
	 */
	public String getPhoto() {
		if(photo==null || photo.trim().isEmpty())
			return "images/user/default.gif";
		return photo;
	}

	/**
	 * @param photo the photo to set
	 */
	public void setPhoto(String photo) {
		this.photo = photo;
	}

	/**
	 * @return the statusName
	 */
	public String getStatusName() {
		return statusName;
	}

	/**
	 * @param statusName the statusName to set
	 */
	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	public Set getDrawMoneyRequestRecords() {
		return drawMoneyRequestRecords;
	}

	public void setDrawMoneyRequestRecords(Set drawMoneyRequestRecords) {
		this.drawMoneyRequestRecords = drawMoneyRequestRecords;
	}

}